package com.takanafu.haru.code{
	import com.takanafu.haru.code.CodeBase;
	
	public class CodeINT extends CodeBase{
		private var value:int;
		
		public function CodeINT(val:int){
			this.value = val;
		}
		
		public function getValue():int{
			return this.value;
		}
		
		override public function toString():String{
			return value.toString();
		}
		
		override public function add(code:CodeBase):CodeBase{
			var result:CodeBase = null;
			var i:CodeINT = code as CodeINT;
			
			result = new CodeINT(this.value + i.getValue());
			return result;
		}
		override public function sub(code:CodeBase):CodeBase{
			var result:CodeBase = null;
			var i:CodeINT = code as CodeINT;
			
			result = new CodeINT(this.value - i.getValue());
			return result;
		}
		override public function mul(code:CodeBase):CodeBase{
			var result:CodeBase = null;
			var i:CodeINT = code as CodeINT;
			
			result = new CodeINT(this.value * i.getValue());
			return result;
		}
		override public function dev(code:CodeBase):CodeBase{
			var result:CodeBase = null;
			var i:CodeINT = code as CodeINT;
			
			result = new CodeINT(this.value / i.getValue());
			return result;
		}
	}
}